package xyz.riceball.usercore.entity.po;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import xyz.riceball.framework.core.bean.BaseDatePO;
import xyz.riceball.framework.core.valid.ValidAdd;
import xyz.riceball.framework.core.valid.ValidEdit;

import javax.validation.constraints.NotBlank;

/**
 * 菜单表(Menu)表实体类
 *
 * @author xiaovcloud
 * @since 2022-04-24 20:17:46
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_rb_menu")
@ApiModel("菜单")
public class MenuPO extends BaseDatePO<MenuPO> {

    @ApiModelProperty("主键")
    @TableId(type = IdType.ASSIGN_ID)
    @NotBlank(message = "主键不能为空", groups = ValidEdit.class)
    private String id;

    @ApiModelProperty(value = "菜单编码")
    @Length(message = "编码长度最大为32", max = 32)
    @NotBlank(message = "编码不能为空")
    private String code;

    @ApiModelProperty(value = "菜单名称")
    @Length(message = "名称长度最大为32", max = 64)
    @NotBlank(message = "名称不能为空")
    private String name;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("菜单图标")
    private String icon;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("父节点")
    private String parentId;

    @ApiModelProperty("菜单类型")
    private Integer type;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("前端路由")
    private String path;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("菜单排序")
    private Integer weight;

    @ApiModelProperty("状态,1为启用,0为禁用")
    private Integer status;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("备注")
    private String remark;

}